﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

using SAS.Toolkit;

public partial class personalifo:basePage
{
    /// <summary>
    /// 用户名
    /// </summary>
    private string usreName = "";
    /// <summary>
    /// 成果列表
    /// </summary>
    protected TeamWorkInfos[] teamWorkList = null;
    /// <summary>
    /// 每个成员的成果列表
    /// </summary>
    protected List<TeamWorkInfos> tList = new List<TeamWorkInfos>();

    protected void Page_Load(object sender, EventArgs e)
    {
        usreName = Request.QueryString["username"].ToString();
        minfo = GetCacheMemberInfo(usreName);
        teamWorkList = GetCacheTeamWorkInfos(1);
        if (GetCacheWorkListByusername(usreName) != null)
        {
            tList = GetCacheWorkListByusername(usreName);
        }
    }
    /// <summary>
    /// 根据成员名获取成果列表
    /// </summary>
    /// <param name="userName"></param>
    /// <returns></returns>
    protected List<TeamWorkInfos> GetCacheWorkListByusername(string username)
    {
        List<TeamWorkInfos> mlist = new List<TeamWorkInfos>();
        mlist.AddRange(teamWorkList);
        //委托
        Predicate<TeamWorkInfos> mpush = new Predicate<TeamWorkInfos>(delegate(TeamWorkInfos work) { return work.Members.Contains(username); });
        mlist = mlist.FindAll(mpush);
        return mlist;
    }
}
